<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录新增</title>
    <script src="ajax.js"></script>
    <script src="jquery-3.4.1.js"></script>

</head>
<body>
<div>
    <!--    <input type="hidden" id="id">-->
    <div>
        <label>
            名字：<input type="text" id="name">
        </label>
    </div>
    <div>
        <label>
            密码：<input type="text" id="password">
        </label>
    </div>
    <div>
        <button id="addClick">提交</button>
    </div>
</div>
<script>
    function showRes(jsonObj) {
        location.href="debackList.html"
    }

   $("#addClick").click(function (e) {
       let nameStr = $("#name").value;
       let passwordStr = $("#password").value;
       let formData = new FormData();
       $(formData).append("name", nameStr);
       $(formData).append("password", passwordStr);
       ajax("http://120.79.234.76:8091/login/add.php", "POST", formData, showRes);

   });

</script>
</body>
</html>